/*
 * @Author: ZephyrGao
 * @Date: 2024-02-21 10:03:32
 * @Description: 全局上下文
 * Copyright (c) 2024 by ZephyrGao, All Rights Reserved. 
 */
import { InjectionKey, Ref } from 'vue';
import { createContext ,useContext } from '../core/useContext';


export interface AppProviderContextProps {
  prefixCls: Ref<string>;
  isMobile: Ref<boolean>;
}

const key: InjectionKey<AppProviderContextProps> = Symbol();

export function createAppProviderContext(context: AppProviderContextProps) {
  return createContext<AppProviderContextProps>(context, key);
}

export function useAppProviderContext() {
  return useContext<AppProviderContextProps>(key);
}
